﻿using Simple.Tools;
using SimpleSaas.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SimpleSaas.Web.Common.redis
/// <summary>
/// 版 本 钢易智企2.0 V 2.0.0 钢易智企2.0
/// Copyright (c) 2023 杭州钢易科技有限公司
/// 创建人：曾东明
/// 日 期：2024
/// 描 述：
/// </summary>
{
	public interface IRedisClientService
	{
		Task DelAsync(string key);
		Task DelHashAsnyc(string key, string[] fields);
		Task<T> GetAsync<T>(string key);
		Task<Dictionary<string, T>> GetHashAllAsync<T>(string key);
		Task<T> GetHashAsync<T>(string key, string field);
		Task<string[]> GetHKeys(string key);
		Task<bool> HashExsitAsync(string key, string field);
		Task<int> HIncrAsync(string key, string field, int num);
		Task SetAsync<T>(string key, T item, TimeSpan expiration);
		Task SetAsync<T>(string key, T item);
		Task SetAsync<T>(string key, T item, int seconds);
		Task SetHashAsync(string key, string field, object value);
		public Task<bool> ExpireAsync(string key, int seconds);
		public Task<long> GetHLenAsync(string key);

		public Task<long> ListLPushAsync<T>(string key, T[] ts);


		public Task<long> ListLPushAsync<T>(string key, T t);


		public Task<long> ListRPushAsync<T>(string key, T[] ts);


		public Task<long> ListRPushAsync<T>(string key, T t);


		public Task<T> ListLPopAsync<T>(string key);


		public Task<T> ListRPopAsync<T>(string key);

		public long ListPush<T>(string key, T t);

		public Task<T[]> ListRangeAsync<T>(string key, long start, long end);

		public Task<long> ListRemAsync(string key, int count, object o);

		public Task<long> ListLenAsync(string key);
		public Task<PageList<T>> ListRangeAsync<T>(string key, BaseParameter Params);

		public Task<int> IncrAsync(string key, TimeSpan time, long value = 1);

		public Task<bool> ExistsAsync(string key);
	}
}